#coding=utf-8
"""
===========================
Author:杭州多测师_周sir
Time:2022/9/14 09:25
website:https://duoceshi.net
===========================
"""
'''
此模块处理conf.ini文件
'''
from    configparser import ConfigParser
from utils.hand_path import *
import os

class Hand_conf(ConfigParser):
    '''当前这个类是用来处理conf.ini文件的工具类'''
    def __init__(self,filename):
        super(Hand_conf,self).__init__()  #继承父类的构造方法
        self.filename = filename   #把传入进来的形式参数赋值给到实例变量self.filename
        self.read(self.filename)    #打开ini文件进行读取

    def get_value(self, section, option):
        '''获取ini文件中的section的option的value值'''
        value = self.get(section,option)
        return value

path = os.path.join(conf_path,"conf.ini")
conf = Hand_conf(path)
print(conf.get_value("env",'url'))
print(conf.get_value("env","headers"))






















